OpenWGA 7.4 - WebTML reference

WebTML tags » [All action calling tags]

<tml:[All action calling tags] param1...param5 ="string">

Purpose:

Defines parameters for the WebTML action

Description:

The parameters will be available to the action as WebTML variables "tmlparam1" to "tmlparam5" and as List object "actionParams" containing the params as list elements 0 to 4.

Only strings can be passed as parameters to WebTML actions. If you use a dynamic WebTML attribute to calculate the contents of the attribute and return a non-string result then this result is converted to a string. If you return a List then the elements will be converted to strings and concatenated to a single string, separated by commas.

If you want to pass different types of objects you might want to consider usage of the TMLScript functions serializeObject() and deserializeObject().

Value(s):

any string

Examples:

A simple example where an action just puts out the first parameter it receives as a message variable.

<tml:action id="display">
setvar("msg", "The button was:" + tmlparam1);
</tml:action>


The same action using the "actionParams" object to retrieve the first parameter:

<tml:action id="display">
setvar("msg", "The button was:" + actionParams.get(0));
</tml:action>


WebTML code which puts out the message and provides three buttons which call the action with different parameters:

<tml:item name="msg"/>

<tml:button clickaction="display" param1="button1">Button 1</tml:button>
<tml:button clickaction="display" param1="button2">Button 2</tml:button>
<tml:button clickaction="display" param1="button2">Button 3</tml:button>